import Taro from '@tarojs/taro';
import { View, Text, Image } from '@tarojs/components';
import { connect } from '@tarojs/redux';
import './index.scss';
import { Component } from 'nervjs';
import GoodsList from '../../components/GoodsList';

@connect(({goods, loading}) => ({
    ...goods,
    ...loading,
}))
export default class Goods extends Component {

    componentDidMount() {
        this.props.dispatch({
            type: 'goods/load',
        });
    }

    render() {
        const { list, effects } = this.props;
        return (
            <View className="goods-page">
                <GoodsList list={list} loading={effects['goods/load']} />
            </View>
        )
    }
}